package Server.logic;

import java.util.ArrayList;

import Server.DataBase.Lesson;
import Server.DataBase.Reg;
import Server.DataBase.Student;

public class Statistics {
	
	public float avgStudents(ArrayList<Student> st){
		float avg=0;
		for(Student s: st ) avg+=avgReg(s.getAreg());
		return avg/st.size();
	}

	public float avgReg(ArrayList<Reg> areg){
		float avg=0;
		for (Reg r: areg) avg+=r.getGrade();
		return(avg/areg.size());
	}
	
	public float avgLessons(ArrayList<Lesson> al){
		float avg=0;
		for(Lesson l: al) avg+=avgReg(l.getAreg());
		return avg/al.size();
	}
}
